<html  xmlns:th="http://www.thymeleaf.org"
       xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1"/>
    <meta charset="utf-8"/>
    <title>米塔云平台管理系统</title>
    <link href="../plugins/selectivity/selectivity-jquery.css" rel="stylesheet">
    <link href="../plugins/bootstrap/bootstrap.min.css" rel="stylesheet">
    <link href="../plugins/bootstrapValidator/bootstrapValidator.min.css" rel="stylesheet">
    <link href="../plugins/font-awesome/css/all.min.css" rel="stylesheet">
    <link href="../customize/css/iconfont.css" rel="stylesheet">
    <link href="../customize/css/content.css" rel="stylesheet">
    <style>
        .time-ruler {
            border: 1px solid #DDDDDD;
            border-radius: 3px;
            padding: 5px .5rem;
            background: #F5F5F5;
        }

        .btn-outline-primary {
            border: 1px solid;
        }
    </style>
</head>
<body>
<div class="m-3">
    <div class="custom-section">
        <nav class="mb-3">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><i class="iconfont icon-xiaolan4"></i> 企业管理</li>
                <li class="breadcrumb-item active"><i class="iconfont icon-xiaolan9"></i> 作息时间管理</li>
            </ol>
        </nav>

        <div class="d-flex align-items-center justify-content-between">
            <div>
                <div shiro:hasAnyPermission="enterprise:time:view,enterprise:time:opera" class="input-group mb-3">
                    <input type="text" class="form-control" placeholder="快捷查询" id="searchValue">
                    <div class="input-group-append">
                        <button class="btn btn-primary" type="button" onclick="loadTimeRule()"><i
                                class="iconfont icon-dituyechaxun"></i></button>
                    </div>
                </div>
            </div>
            <div>
                <button shiro:hasPermission="enterprise:time:opera" class="btn btn-primary" type="button" onclick="addInfo()"><i class="fa fa-plus"></i> 添加时间规则
                </button>
            </div>
        </div>
        <table class="table table-striped table-bordered" id="time_List">
            <thead>
            <tr>
                <th>#</th>
                <th>企业名称</th>
                <th>时间规则</th>
                <th shiro:hasPermission="enterprise:time:opera">操作</th>
            </tr>
            </thead>
            <tbody>

            </tbody>
        </table>
        <div id="page" class="page_div"></div>
    </div>
</div>
<!-- Modal -->
<div shiro:hasPermission="enterprise:time:opera"  class="modal fade" id="addInfoModal" data-backdrop="static" tabindex="-1">

    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content text-body" id="addInfoForm" style="margin-bottom: 80px;">
            <div class="modal-header">
                <div class="modal-title"><i class="iconfont icon-juxing"></i><span id="modal_title"></span></div>
                <button type="button" class="close" data-dismiss="modal">
                    <span>&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="text-secondary font-p12 mb-2">注：带<span class="form-required">*</span><span class="ml-3"></span>标识的为必填项</div>
                <form id="form1">
                    <div class="form-group row">
                        <label class="col-sm-3 col-form-label" for="company-list">企业名称<span class="form-required">*</span></label>
                        <div class="col-sm-8">
                            <input type="hidden" name="methodType" value="0" id="methodType_id">
                            <input type="hidden" name="eIdT" id="eIdT_id">
                            <div class="selectivity-input form-control" id="company-list" onchange="companyChange($(this).selectivity('val'))"></div>
                            <input class="form-control position-absolute" type="text" name="eId" id="company-list-vld" style="opacity: 0">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-3 col-form-label">时间规则<span class="form-required">*</span></label>
                        <div class="col-sm-8 font-p14" id="timeRule_List">
                        </div>
                    </div>
                </form>
                <div class="text-center">
                    <button class="btn btn-sm btn-outline-primary" type="button" onclick="addRuler()">添加规则</button>
                </div>
                <form class="mx-3 mt-3" id="add_ruler_wrapper"
                      style="display:none; border: 1px solid #97C3FF; padding: 0 5px; border-radius: 4px;">
                    <div class="d-inline-block font-p14"
                         style="margin-top: -0.7rem; background: #FFFFFF; padding: 0 5px;">添加规则
                    </div>
                    <div class="form-group row mt-3">
                        <label class="col-sm-3 col-form-label" for="validationCustom11">工作时间<span class="form-required">*</span></label>
                        <div class="col-sm-8 mb-2">
                            <input class="form-control" type="text" name="" id="validationCustom11" placeholder="开始时间" autocomplete="off">
                        </div>
                        <div class="col-sm-8 offset-3">
                            <input class="form-control" type="text" name="" id="validationCustom12" placeholder="结束时间" autocomplete="off">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-3 col-form-label">重复<span class="form-required">*</span></label>
                        <div class="col-sm-9 mb-2">
                            <div class="custom-control custom-checkbox custom-control-inline">
                                <input type="checkbox" id="customCheckboxInline1" name="weekList"
                                       class="custom-control-input" value="周一">
                                <label class="custom-control-label" for="customCheckboxInline1">周一</label>
                            </div>
                            <div class="custom-control custom-checkbox custom-control-inline">
                                <input type="checkbox" id="customCheckboxInline2" name="weekList"
                                       class="custom-control-input" value="周二">
                                <label class="custom-control-label" for="customCheckboxInline2">周二</label>
                            </div>
                            <div class="custom-control custom-checkbox custom-control-inline">
                                <input type="checkbox" id="customCheckboxInline3" name="weekList"
                                       class="custom-control-input" value="周三">
                                <label class="custom-control-label" for="customCheckboxInline3">周三</label>
                            </div>
                            <div class="custom-control custom-checkbox custom-control-inline">
                                <input type="checkbox" id="customCheckboxInline4" name="weekList"
                                       class="custom-control-input" value="周四">
                                <label class="custom-control-label" for="customCheckboxInline4">周四</label>
                            </div>
                            <div class="custom-control custom-checkbox custom-control-inline">
                                <input type="checkbox" id="customCheckboxInline5" name="weekList"
                                       class="custom-control-input" value="周五">
                                <label class="custom-control-label" for="customCheckboxInline5">周五</label>
                            </div>
                            <div class="custom-control custom-checkbox custom-control-inline">
                                <input type="checkbox" id="customCheckboxInline6" name="weekList"
                                       class="custom-control-input" value="周六">
                                <label class="custom-control-label" for="customCheckboxInline6">周六</label>
                            </div>
                            <div class="custom-control custom-checkbox custom-control-inline">
                                <input type="checkbox" id="customCheckboxInline7" name="weekList"
                                       class="custom-control-input" value="周日">
                                <label class="custom-control-label" for="customCheckboxInline7">周日</label>
                            </div>
                        </div>
                    </div>
                    <div class="col-12 mb-3 pl-5">
                        <button type="button" class="btn btn-sm btn-info" onclick="confirmSelection()">确认添加</button>
                        <button type="button" class="btn btn-sm btn-light" onclick="cancelSelection()">取消</button>
                        <span class="font-p12 text-secondary">确认添加将在保存后生效</span>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" onclick="submitData()">提交保存</button>
            </div>
        </div>
    </div>
</div>
</body>
<script src="../plugins/jquery-3.4.1.min.js"></script>
<script src="../plugins/bootstrap/bootstrap.bundle.min.js"></script>
<script src="../plugins/bootstrapValidator/bootstrapValidator.min.js"></script>
<script src="../plugins/bootstrapValidator/zh_CN.js"></script>
<script src="../plugins/alert.js"></script>
<script src="../plugins/paging.js"></script>
<script src="../plugins/laydate/laydate.js"></script>
<script src="../plugins/selectivity/selectivity-jquery.js"></script>
<script src="../customize/js/common.js"></script>
<script src="../customize/js/CommonUtils.js"></script>
<script src="../customize/js/customModalV2.js"></script>
<script src="../customize/js/timeManagement.js"></script>
<script>
    var title = ['#', '企业名称', '时间规则'];
    var label = ['order', 'name', 'rule'];
    var enterpriseTimeView=false;
    var enterpriseTimeOpera=false;
</script>
<shiro:hasPermission name="enterprise:time:view">
    <script>
        enterpriseTimeView =true;
    </script>
</shiro:hasPermission>
<shiro:hasPermission name="enterprise:time:opera">
    <script>
        enterpriseTimeOpera=true;
        title.push('操作');
        label.push('opera');
    </script>
</shiro:hasPermission>
</html>